import service from '@/utils/crmRequest'

export default () => ({

  // 签约代理商列表
  AGENT_OPENED_ACCOUNT_LIST: function(data) {
    return service({
      url: '/api/agent/opened-account/list',
      method: 'post',
      data
    })
  },

  // 申请变更
  AGENT_OPENED_ACCOUNT_EDIT: function(data) {
    return service({
      url: '/api/agent/edit',
      method: 'put',
      data
    })
  },

  // 解除合作
  AGENT_END: function(id) {
    return service({
      url: `/api/agent/end?id=${id}`,
      method: 'put',
    })
  },

  // 注销代理商
  AGENT_OUT: function(id) {
    return service({
      url: `/api/agent/out?id=${id}`,
      method: 'put',
    })
  },

  // 产品与价格列表
  AGENT_PRODUCT_LIST: function(data) {
    return service({
      url: `/api/agentProduct/list`,
      method: 'post',
      data
    })
  },

  // 产品与价格新增
  AGENT_PRODUCT_CREATE: function(data) {
    return service({
      url: `/api/agentProduct/create`,
      method: 'post',
      data
    })
  },

  // 精细要素新增
  AGENT_PRODUCT_CREATE_TERMINAL: function(data) {
    return service({
      url: `/api/agentProduct/create_with_terminals`,
      method: 'post',
      data
    })
  },

  // 产品与价格详情
  AGENT_PRODUCT_DETAIL: function(id) {
    return service({
      url: `/api/agentProduct/detail?id=${id}`,
      method: 'get',
    })
  },

  // 产品与价格申请变更
  AGENT_PRODUCT_UPDATE: function(data) {
    return service({
      url: `/api/agentProduct/update`,
      method: 'put',
      data
    })
  },

  // 产品与价格申请作废
  AGENT_PRODUCT_BAN: function(data) {
    return service({
      url: `/api/agentProduct/ban`,
      method: 'put',
      data
    })
  },

  // 产品与价格注册终端
  AGENT_SET_TERMINAL: function(data) {
    return service({
      url: `/api/dev/agent-set-terminal`,
      method: 'post',
      data
    })
  },

  // 交易终端列表
  TRADING_TERMINAL_LIST: function(data) {
    return service({
      url: `/api/relationStandard/getList-from-agent`,
      method: 'post',
      data
    })
  },

  // 开发终端列表
  DEV_AGENT_PRODUCT_LIST: function(data) {
    return service({
      url: `/api/dev/list-for-agent-product`,
      method: 'post',
      data
    })
  },

  // 正式终端列表
  RELATION_AGENT_PRODUCT_LIST: function(data) {
    return service({
      url: `/api/relationStandard/getList-from-agent-product`,
      method: 'post',
      data
    })
  },

  // 终止开发
  TRADING_TERMINAL_END: (id) => {
    return service({
      url: `/api/relationStandard/end?id=${id}`,
      method: 'put',
    })
  },

  // 代理-交易中终端-变更终端列表
  RELATIONSTANDARD_CHANGE_AGENT_LIST: (data) => {
    return service({
      url: `/api/relationStandard/getList-from-change-agent`,
      method: 'post',
      data
    })
  },

  // 代理--- 变更---添加终端---获取列表
  RELATIONSTANDARD_CHANGE_AGENT_LIST_BYID: (data) => {
    return service({
      url: `/api/relationStandard/getList-by-agent-product`,
      method: 'post',
      data
    })
  },

  // 代理-产品聚合列表
  AGENTPRODUCT_PRODUCT_LIST: (id) => {
    return service({
      url: `/api/agentProduct/product-list?id=${id}`,
      method: 'get',
    })
  },

  //
  RELATIONSTANDARD_SET_AGENT_TRADE_PRICE: (data) => {
    return service({
      url: `/api/relationStandard/set-agent-trade-price`,
      method: 'post',
      data
    })
  },

  //
  RELATIONSTANDARD_SET_NEW_AGENT_PRICE: (data) => {
    return service({
      url: `/api/relationStandard/set-new-agent-price`,
      method: 'post',
      data
    })
  },

  // 渠道---正式交易关系---变更代理
  RELATIONSTANDARD_GET_LIST_BY_AGENT_PRODUCT: (data) => {
    return service({
      url: `/api/relationStandard/getList-by-agent-product`,
      method: 'post',
      data
    })
  },

  // 渠道---正式交易关系---变更代理
  RELATIONSTANDARD_GET_LIST_BY_EDIT_AGENT_PRODUCT: (data) => {
    return service({
      url: `/api/relationStandard/getList-by-edit-agent-product`,
      method: 'post',
      data
    })
  },

  // 更新价格
  AGENT_PRODUCT_UPDATE_PRICE: (data) => {
    return service({
      url: `/api/agentProduct/update-price`,
      method: 'put',
      data
    })
  },

  // 产品与价格再次编辑
  AGENT_PRODUCT_EDIT: (data) => {
    return service({
      url: `/api/agentProduct/edit`,
      method: 'put',
      data
    })
  },

  // 产品与价格删除
  AGENT_PRODUCT_DELETE: (id) => {
    return service({
      url: `/api/agentProduct/delete?id=` + id,
      method: 'delete',
    })
  },

  // 产品与价格判断作废
  AGENT_PRODUCT_BANJUDGE: (id) => {
    return service({
      url: `/api/agentProduct/ban-judge?id=` + id,
      method: 'get',
    })
  },

  // 获取地区
  AGENT_PRODUCT_REGION: (params) => {
    return service({
      url: `/api/agentProduct/region`,
      method: 'get',
      params
    })
  },

  // 产品信息聚合
  AGENT_PRODUCT_PRODUCT_LIST: (params) => {
    return service({
      url: `/api/agentProduct/product-list`,
      method: 'get',
      params
    })
  },

  // 交易终端产品信息聚合
  RELATIONSTANDARD_PRODUCT_LIST: (params) => {
    return service({
      url: `/api/relationStandard/product-list`,
      method: 'get',
      params
    })
  },

  //
  DEV_SEARCH_TERMINALS_LIST: (data) => {
    return service({
      url: `/api/dev/list-for-search-terminals`,
      method: 'post',
      data
    })
  },

  //
  DISTRIBUTE_CONTRACT_DETAIL_ASSOCIATION: (data) => {
    return service({
      url: `api/distributeContractDetail/disTerAssociation2`,
      method: 'post',
      data
    })
  },

  DISTRIBUTE_CONTRACT_DETAIL_LIST: (data) => {
    return service({
      url: `api/distributeContractDetail/getAgentDevDis`,
      method: 'post',
      data
    })
  },

  PRODUCT_PRICE_STRATEGY_MIN_PRICE: (data) => {
    return service({
      url: `api/productPriceStrategy/getMinPriceList`,
      method: 'post',
      data
    })
  },
})

